{template 'header'}
<link rel="stylesheet" type="text/css" href="{AJ_SKIN}style.css"/>
<div class="m">
	<div class="left_box">		
		<div class="pos">当前位置: <a href="{$MODULE[1][linkurl]}">首页</a> &raquo; <a href="{$MOD[linkurl]}">{$MOD[name]}</a> &raquo; 意向登记单</div>
		<div class="pd20">
				<form method="post" action="{$MOD[linkurl]}inquiry.php" id="dform" onsubmit="return check();">
				<input type="hidden" name="forward" value="{$forward}"/>
				<input type="hidden" name="itemids" value="{$itemids}"/>
				<table cellpadding="6" cellspacing="1" width="100%">
				<tr>
				<td bgcolor="#FBFCFD" width="200" align="right">房源/服务：</td>
				<td bgcolor="#FFFFFF">
				{loop $list $v}
				<div>&raquo; <a href="{$MOD[linkurl]}{$v[linkurl]}" target="_blank" class="px14 f_b">{$v[title]}</a> <a href="{userurl($v[username])}" target="_blank">({$v[company]})</a>{if $v[vip]} <img src="{AJ_SKIN}image/vip.gif"/>{/if}</div>
				<div class="b10"></div>
				{/loop}
				</td>
				</tr>
				
				<tr>
				<td bgcolor="#FBFCFD" align="right"><span class="f_red">*</span> 意向登记标题：</td>
				<td bgcolor="#FFFFFF"><input type="text" name="title" value="{$title}" size="60" id="title" class="pd3"/>&nbsp;&nbsp;<span class="f_gray">建议您修改主题，吸引对方注意,得到优先回复!</span> <br/><span class="f_red" id="dtitle"></span></td>
				</tr>

				<tr>
				<td bgcolor="#FBFCFD" align="right">我想了解：</td>
				<td bgcolor="#FFFFFF">
				
				<table cellpadding="2" cellspacing="2">
				{loop $itype $k $v}
				{if $k%5==0}<tr>{/if}
				<td><input type="checkbox" name="type[]" value="{$v}" id="type_{$k}"{if $k<5} checked{/if}/><label for="type_{$k}"> {$v}</label></td>
				{if $k%5==4}</tr>{/if}
				{/loop}
				</table>

				</td>
				</tr>

				<tr>
				<td bgcolor="#FBFCFD" align="right">快捷提问：</td>
				<td bgcolor="#FFFFFF">
				<select onchange="if(this.value)Dd('content').value+=this.value+'\n';">
				<option value="">请选择常用问题</option>
				{loop $iask $v}
				<option value="{$v}">{$v}</option>
				{/loop}
				</select>
				<span class="f_gray">(不用打字 “快捷提问”帮您忙！) </span>
				</td>
				</tr>

				<tr>
				<td bgcolor="#FBFCFD" align="right"><span class="f_red">*</span> 主要内容：</td>
				<td bgcolor="#FFFFFF"><textarea rows="8" cols="80" name="content" id="content" class="pd3"></textarea><br/>
				我希望在 {dcalendar('date', $date)} 日前回复 <span class="f_red" id="dcontent"></span>
				</td>
				</tr>

				<tr>
				<td bgcolor="#FBFCFD" align="right">我的联系方式：</td>
				<td bgcolor="#FBFCFD">
				{if $_userid}
				<table cellpadding="5" cellspacing="5">
				<tr>
				<td>联系人：</td>
				<td>{$truename}</td>
				<td>公司名：</td>
				<td>{$company}</td>
				</tr>
				<tr>
				<td>电子邮件：</td>
				<td>{$email}</td>
				<td>联系电话：</td>
				<td>{$telephone}</td>
				</tr>
				<tr>
				<td>联系QQ：</td>
				<td>{$qq}</td>
				<td>联系MSN：</td>
				<td>{$msn}</td>
				</tr>
				</table>
				{else}
				<table cellpadding="5" cellspacing="5">
				<tr>
				<td colspan="2">还不是会员，请 <a href="{$MODULE[2][linkurl]}{$AJ[file_register]}" class="f_b">注册</a> 或 请留下您的联系方式(有 <span class="f_red">*</span> 的是必填项)：已经是会员？请 <a href="{$MODULE[2][linkurl]}{$AJ[file_login]}" class="f_b">登录</a></td>
				</tr>
				<tr>
				<td>公司名</td>
				<td><input type="text" name="company" size="30" id="company"/></td>
				</tr>
				<tr>
				<td>联系人<span class="f_red">*</span></td>
				<td><input type="text" name="truename" size="30" id="truename"/><br/><span class="f_red" id="dtruename"></span></td>
				</tr>
				<tr>
				<td>联系电话<span class="f_red">*</span></td>
				<td><input type="text" name="telephone" size="30" id="telephone"/><br/><span class="f_red" id="dtelephone"></span></td>
				</tr>
				<tr>
				<td>电子邮箱</td>
				<td><input type="text" name="email" size="30" id="email"/></td>
				</tr>
				{if $AJ[im_qq]}
				<tr>
				<td>QQ </td>
				<td><input type="text" size="20" name="qq" id="qq"/></td>
				</tr>
				{/if}
				{if $AJ[im_ali]}
				<tr>
				<td>阿里旺旺 </td>
				<td><input type="text" size="20" name="ali" id="ali"/></td>
				</tr>
				{/if}
				{if $AJ[im_msn]}
				<tr>
				<td>MSN </td>
				<td><input type="text" size="30" name="msn" id="msn"/></td>
				</tr>
				{/if}
				{if $AJ[im_skype]}
				<tr>
				<td>Skype </td>
				<td><input type="text" size="20" name="skype" id="skype"/></td>
				</tr>
				{/if}
				</table>
				{/if}
				</td>
				</tr>
				{if $need_captcha}
				<tr>
				<td bgcolor="#FBFCFD" align="right"> 验证码<span class="f_red">*</span></td>
				<td bgcolor="#FFFFFF">{template 'captcha', 'chip'} <span id="dcaptcha" class="f_red"></span></td>
				</tr>
				{/if}
				{if $need_question}
				<tr>
				<td bgcolor="#FBFCFD" align="right"> 验证问题<span class="f_red">*</span></td>
				<td bgcolor="#FFFFFF">{template 'question', 'chip'} <span id="danswer" class="f_red"></span></td>
				</tr>
				{/if}
				{if $_userid && $AJ[sms]}
				<tr>
				<td bgcolor="#FBFCFD" align="right">短信通知：</td>
				<td bgcolor="#FFFFFF"><input type="checkbox" name="sendsms" value="1"/> 发送短信通知至接收人手机 (<a href="{$MODULE[2][linkurl]}sms.php" target="_blank">我的可用短信 <strong class="f_blue">{$_sms}</strong> 条</a>)</td>
				</tr>
				{/if}
				<tr>
				<td bgcolor="#FBFCFD"> </td>
				<td bgcolor="#FFFFFF"><input type="submit" name="submit" value=" 发送{if $total==1}意向登记单{else}批量咨询{/if} " class="pd3 px14 f_b"/>

				{if $MG[inquiry_limit]}
				&nbsp;&nbsp;&nbsp;今日可意向登记 <span class="f_b f_red">{$MG[inquiry_limit]}</span> 次
				&nbsp;&nbsp;&nbsp;当前已意向登记 <span class="f_b">{$limit_used}</span> 次
				&nbsp;&nbsp;&nbsp;还可以意向登记 <span class="f_b f_blue">{$limit_free}</span> 次
				{/if}
				
				</td>
				</tr>
				</table>
				</form>
				<script type="text/javascript">
				function check() {
					var l;
					var f;
					f = 'title';
					l = Dd(f).value.length;
					if(l < 5 || l > 50) {
						Dmsg('标题应为5-50字，当前已输入'+l+'字', f);
						return false;
					}
					f = 'content';
					l = Dd(f).value.length;
					if(l < 10 || l > 2000) {
						Dmsg('内容应为10-2000字，当前已输入'+l+'字', f);
						return false;
					}
					{if !$_userid}
					f = 'truename';
					l = Dd(f).value.length;
					if(l < 2) {
						Dmsg('请填写联系人', f);
						return false;
					}
					f = 'telephone';
					l = Dd(f).value.length;
					if(l < 7) {
						Dmsg('请填写联系电话', f);
						return false;
					}
					{/if}
					{if $need_captcha}
					f = 'captcha';
					l = Dd(f).value;
					if(!is_captcha(l)) {
						Dmsg('请填写正确的验证码', f);
						return false;
					}
					if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
						Dd(f).focus();
						return false;
					}
					{/if}
					{if $need_question}
					f = 'answer';
					l = Dd(f).value.length;
					if(l < 1) {
						Dmsg('请填写验证问题', f);
						return false;
					}
					if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
						Dd(f).focus();
						return false;
					}
					{/if}
				}
				</script>
		</div>
	</div>
</div>
{template 'footer'}